burette.dynamo.heureux-cyclage.org
burette.ptitvelo.heureux-cyclage.org
burette.ptitvelo.net
- burette.velosenville.org;
+ burette.velorution.org
+ burette.velorution_idf.heureux-cyclage.org
+ burette.velosenville.org
+ burette.vieuxbiclou.heureux-cyclage.org
+ burette.vieuxbiclou.org;
return 301 https://$host$request_uri;
}
fail_timeout=300s
weight=1;
}
+map $http_host $burette_dbfilter {
+ default "";
+ burettes.heureux-cyclage.org ".*$";
+ burette.atelierdynamo.fr "dynamo$";
+ burette.cyclocoop.heureux-cyclage.org "cyclo_.*$";
+ burette.cyclocoop.org "cyclo_.*$";
+ burette.dynamo.heureux-cyclage.org "dynamo$";
+ burette.ptitvelo.heureux-cyclage.org "ptitvelo$";
+ burette.ptitvelo.net "ptitvelo$";
+ burette.velorution.org "velorution_idf$";
+ burette.velorution_idf.heureux-cyclage.org "velorution_idf$";
+ burette.velosenville.heureux-cyclage.org "velosenville$";
+ burette.velosenville.org "velosenville$";
+ burette.vieuxbiclou.heureux-cyclage.org "vieuxbiclou$";
+ burette.vieuxbiclou.org "vieuxbiclou$";
+ }
burette.dynamo.heureux-cyclage.org
burette.ptitvelo.heureux-cyclage.org
burette.ptitvelo.net
- demo.burette.ptitvelo.net
+ burette.velorution.org
+ burette.velorution_idf.heureux-cyclage.org
burette.velosenville.org
- demo.burette.velosenville.org;
+ burette.vieuxbiclou.heureux-cyclage.org
+ burette.vieuxbiclou.org;
client_body_buffer_size 1024k;
client_max_body_size 10m;
# NOTE: by default, do not forward anything
proxy_read_timeout 500;
proxy_set_header Host $host;
+ proxy_set_header OpenERP-DB-Filter $burette_dbfilter;
+ # TODO: utiliser un certificat utilisateurice X.509
+ # pour initialiser cette variable.
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
# NOTE: let the OpenERP web service know that we're using HTTPS,
export LOGNAME="$sv"
# NOTE: openerp utilise /tmp/oe-sessions-$LOGNAME
+/bin/grep --fixed-strings --quiet --word-regexp HTTP_OPENERP_DB_FILTER \
+ /usr/share/pyshared/openerp/addons/web/controllers/main.py ||
+/usr/bin/patch --forward --reject-file=- --strip=0 --unified <<-EOF
+ --- /usr/share/pyshared/openerp/addons/web/controllers/main.py 2013-12-01 05:06:50.121954391 +0100
+ +++ /usr/share/pyshared/openerp/addons/web/controllers/main.py 2013-12-01 05:07:44.917954389 +0100
+ @@ -90,6 +90,8 @@
+ h = req.httprequest.environ['HTTP_HOST'].split(':')[0]
+ d = h.split('.')[0]
+ r = openerp.tools.config['dbfilter'].replace('%h', h).replace('%d', d)
+ + f = req.httprequest.environ['HTTP_OPENERP_DB_FILTER']
+ + r = r.replace('%f', f)
+ dbs = [i for i in dbs if re.match(r, i)]
+ return dbs
+
+ EOF
+
for db in \
cyclo_ivry \
cyclo_pantin \
/usr/bin/openerp-server \
--config /etc/openerp/"$version"/"${sv#openerp7_}"/server.conf \
--load-language=fr_FR \
+ --db-filter="^${sv}_%f" \
"$@"